<me:UIABAX x:Class="WPFExcelReport.TICC_ABAX"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"   
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIABAX.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIABAX.Resources> 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition> 
        </Grid.RowDefinitions> 
        <StackPanel  Grid.Row="0" Grid.Column="0">
            <WrapPanel >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-right.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=选择任意一行，则相同供应商会被自动创建}}"/>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="CheckLiefDat" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=核对供应商}}"/>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=新采购单:}}"   Margin="0,0,0,0"></TextBlock>
                    <TextBlock Grid.Column="1"   Text="{Binding KRS}" Width="30" />
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0"    Margin="0,0,0,0"></TextBlock>
                    <TextBlock Grid.Column="1"   Text="{Binding LFD}" Width="80" />
                </Grid>
            </WrapPanel>
        </StackPanel>
        <DataGrid Grid.Row="1" Grid.Column="0"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="{Binding Source={Localization:Translate Word=采购单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFKRS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFLFD}" Header="{Binding Source={Localization:Translate Word=需求单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFPOS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAART}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSLIEFNR}" Header="{Binding Source={Localization:Translate Word=供应商}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSLIEFNA,Converter={StaticResource ResourceKey=gb2312}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABARESMG,Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=需求}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=PREK}" Header="{Binding Source={Localization:Translate Word=单价}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=F01DES}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=UM}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABADATE}" Header="{Binding Source={Localization:Translate Word=需求日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  > 
    </Grid>  
</me:UIABAX>
